package com.geek.crowdhub.dto.mapper.business;

import cn.hutool.core.util.ObjectUtil;
import com.geek.crowdhub.dto.model.business.CampaignIntroDto;
import com.geek.crowdhub.model.business.CampaignIntro;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class CampaignIntroMapper {
    @Autowired
    private ModelMapper modelMapper;

    public CampaignIntroDto toCampaignIntroDto(CampaignIntro model) {
        if (ObjectUtil.isEmpty(model)) {
            return null;
        }
        return modelMapper.map(model,CampaignIntroDto.class);
    }
}
